package com.ocom.srvpaccess.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.access.EntityMjYkm;
import com.ocom.common.entity.master.EntityYkmCenterConfig;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;
import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.srvpaccess.dao.IDaoYkmCenterConfig;
import com.ocom.srvpaccess.service.YkmCenterConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YkmCenterConfigServiceImpl extends ServiceImpl<IDaoYkmCenterConfig, EntityYkmCenterConfig> implements YkmCenterConfigService {

    @Autowired
    private IDaoYkmCenterConfig iDaoYkmCenterConfig;


    @DataSourceAspect(type= DataSourceEnum.MAIN_DB,isMaster = MasterSlaveEnum.SLAVE)
    @Override
    public List<EntityYkmCenterConfig> selectHourTime(String hourTime) {
        QueryWrapper<EntityYkmCenterConfig> query = Wrappers.query();
        query.eq("hour_time",hourTime);
        List<EntityYkmCenterConfig> list=iDaoYkmCenterConfig.selectList(query);
        return list;
    }
}
